﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using ChatRoom.ViewModel;

namespace ChatRoom
{
    public partial class MainPage : UserControl, IChatRoomView
    {
        private ChatRoomViewModel _viewModel;

        public MainPage()
        {
            InitializeComponent();
        }

        private void OnLoaded(object sender, RoutedEventArgs e)
        {
            _viewModel = new ChatRoomViewModel(this);
            this.DataContext = _viewModel;
            _viewModel.OnLoaded();
        }

        public void ShowErrorMsg(string message)
        {
            MessageBox.Show(message, "Error", MessageBoxButton.OK);
        }
    }
}
